const { DataTypes } = require("sequelize");
const seq = require("../db/seq");

const Product = seq.define("newsP_product", {
  title: {
    type: DataTypes.STRING,
    unique: true,
    allowNull: false,
    comment: "标题",
  },
  introduction: {
    type: DataTypes.STRING,
    allowNull: false,
    comment: "产品简介",
  },
  detail: {
    type: DataTypes.TEXT,
    allowNull: false,
    comment: "产品详细描述",
  },
  cover: {
    type: DataTypes.STRING,
    allowNull: false,
    comment: "封面",
  },
  editTime: {
    type: DataTypes.DATE,
    allowNull: false,
    comment: "修改时间",
  },
});

// Product.sync({ force: true });

module.exports = Product;
